package com.gc.server.dao;

import com.gc.server.entity.SchoolEntity;
import com.gc.server.vo.SchoolVo;
import org.apache.ibatis.annotations.Mapper;
import com.yf.dao.BaseDao;
import org.apache.ibatis.annotations.Param;

import java.util.List;
/**
 * 学校Dao
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date Thu Oct 22 19:28:49 CST 2020
 */
@Mapper
public interface SchoolDao extends BaseDao<SchoolEntity> {

    List<SchoolVo> findVo(SchoolVo vo);

    SchoolVo getVo(Long id);


    List<SchoolEntity> findByUserId(Long userId);

    List<SchoolEntity> findByRouteId(Long routeId);

    SchoolEntity findByCode(String code);

    void rmUser(@Param("userId") Long userId, @Param("schoolId") Long schoolId);

    void rmUserByUser(@Param("userId") Long userId);

    void addUser(@Param("schoolId") Long schoolId, @Param("userIds") List<Long> userIds);

    void addSchool(@Param("schoolIds") List<Long> schoolIds, @Param("userId") Long userId);
}
